<?php
class Catalog_Form_QuickSearch extends Zend_Form
{
    public function init()
    {
        $this->setMethod('post');

        $router = Zend_Controller_Front::getInstance()->getRouter();
        $action = $router->assemble(array(
                'action'=>'search',
                'controller'=>'product',
                'module'=>'catalog'));
        $this->setAction($action);

        $this->addElement('text', 'phrase', array(
            'label'      => null,
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array()
        ));

        $listFilter = new Catalog_Model_ProductSearchFilter();
        $data = $listFilter->getData();
        $this->getElement('phrase')->setValue($data['phrase']);

        $this->addElement('submit', 'submit', array(
            'label'    => 'Search',
        ));
    }
}
